lint against repeated repr attributes - #157036
Conversation
This comment has been minimized.
This comment has been minimized.
|
Wearing my lang hat but not speaking as team consensus (since we've not talked about it): I think you should start with the "obviously good" version, and we can do future PRs later to expand it or to update severity. Concretely, thus, I'd say it should be a warning (because if it's inert it doesn't need to be deny) when you have a clearly-unnecessary one that wasn't emitted from a macro, or something like that. (Our bar in the compiler for deny-by-default is pretty high. My personal heuristic is whether it's worth running your unit tests despite the warning, and an inert extra attribute doesn't need to block that.) We can then look at impacts and ratchet it up over time or over an edition, but those decisions can be made later and don't need to block you making a useful lint in the meantime. I'm a bad reviewer for lint stuff code-wise, though, so let's try |
|
+1 to what @scottmcm said on how best to approach this. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
This comment has been minimized.
This comment has been minimized.
ae3cdee to
314903c
Compare
|
r? jdonszelmann |
because that's been nagging me for weeks now.
d1a8d0d to
224a101
Compare
|
@jdonszelmann you've still got requested changes here (just in the UI, i did do the thing you wanted me to). it also doesn't look like this ping worked, so i guess i'll try it myself? though i don't think it'll go through. @rust-lang/lang |
|
(Nominating to look at in triage tomorrow; sorry for the delay) This adds a new #[repr(transparent)]
#[repr(transparent)]Hopefully this is an easy accept because we'd talked about doing this in a previous meeting 🙂 |
|
Looks OK to me modulo I'd expect this to go in the |
|
Let's propose to do this modulo putting this in the @rfcbot fcp merge lang |
|
@traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
@rfcbot reviewed |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
View all comments
fixes #156029 by adding a lint against repeated repr attributes.
r? scottmcm